package com.jdym.back.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 还款表
 * </p>
 *
 * @author ${author}
 * @since 2021-09-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="Return对象", description="还款表")
public class Return implements Serializable {

    private static final long serialVersionUID = 1L;

    private Firm firm;
    private CoBank co_bank;
    private Overdue overdue;

    @TableId(value = "return_id", type = IdType.AUTO)
    private Integer returnId;

    @ApiModelProperty(value = "银行id")
    private Integer bankId;

    private LocalDateTime returnDeadline;

    @ApiModelProperty(value = "未还金额")
    private BigDecimal returnntAmount;

    @ApiModelProperty(value = "已还金额")
    private BigDecimal returnedAmount;

    @ApiModelProperty(value = "还款日期")
    private LocalDateTime returnTime;

    @ApiModelProperty(value = "还款方式")
    private String returnMethod;

    @ApiModelProperty(value = "企业id")
    private Integer firmId;

    @ApiModelProperty(value = "逾期id")
    private Integer overdueId;

    @ApiModelProperty(value = "是否逾期")
    private Integer isOverdue;

    @ApiModelProperty(value = "还款状态")
    private Integer returnStatus;

    @ApiModelProperty(value = "信用评分")
    private Integer returnCredit;

    @ApiModelProperty(value = "截止日期")
    @TableField(exist = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date finalDate;

    @ApiModelProperty(value = "未还金额")
    @TableField(exist = false)
    private BigDecimal notReturn;

    @TableField(exist = false)
    private String firmName;

    @ApiModelProperty(value = "贷款金额")
    @TableField(exist = false)
    private BigDecimal loanAmount;

    @ApiModelProperty(value = "贷款日期")
    @TableField(exist = false)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate createtime;

    @ApiModelProperty(value = "贷款期限（贷的年限）")
    @TableField(exist = false)
    private Integer loanDeadline;

//    是否逾期
    @ApiModelProperty(value = "是否逾期(0未逾期，1逾期)")
    @TableField(exist = false)
    private int overDate;
}
